<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.util.*" %>
<%@ page import="com.zust.java.bean.*" %>
<%@ page import="java.text.SimpleDateFormat" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Processor Order Page</title>
</head>
<body>
    <%
        List<Order> list =(List<Order>) request.getSession().getAttribute("processorOrder");
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
        Account account = (Account) request.getSession().getAttribute("account");
    %>
    <table border="1px" style="text-align:center">
        <tr>
            <th>订单号</th>
            <th>创建时间</th>
            <th>截止日期</th>
            <th>下单者</th>
            <th>操作</th>
        </tr>
        <%
            for (Order o : list) {
        %>
        <tr>
            <td><%= o.getOrderNo() %></td>
            <td><%= dateFormat.format(o.getCreatTime())%></td>
            <td><%= dateFormat.format(o.getDeadline()) %></td>
            <td><%= o.getAccount().getUsername() %></td>
            <td>
                <button onclick="window.location.href='selectProcessorOrderDetail?orderNo=<%= o.getOrderNo() %>&account1=<%= account.getAccount() %>&type=<%= account.getType() %>'">查看详情</button>
            </td>
        </tr>
        <% } %>
    </table>
    <br><button onclick="window.history.back()">返回</button>
</body>
</html>